package com.qf.qfjob.handlers;

import com.qf.qfleadnewsfeignapi.article.ApArticleApi;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
@Slf4j
public class HotNewsComputeHandler {

    @Autowired
    private ApArticleApi apArticleApi;

    @XxlJob("computeHotArticleJob")
    public void compute(){
        log.info("定时计算热点新闻开始...." + LocalDateTime.now());

        //计算热点-将计算出来的热点信息存储到redis
        apArticleApi.computeHot();
    }
}
